import { createStore } from 'vuex';
import login from './login/login';
interface IRootState {
  name: string;
  entireRoles: any[];
  entireDepartments: any[];
  entireMenus: any[];
}

const store = createStore<IRootState>({
  state() {
    return {
      name: 'coderwhy',
      entireRoles: [],
      entireDepartments: [],
      entireMenus: []
    };
  },
  getters: {},
  mutations: {},
  actions: {},
  modules: {
    login
  }
});
export function setupStore() {
  store.dispatch('login/loadLocalCache');
  // store.dispatch('getInitalDataAction')
}

export default store;
